		
#region (c) Comtrade IT Solutions and Services
//
// All rights are reserved. Reproduction or transmission in whole or in part, in
// any form or by any means, electronic, mechanical or otherwise, is prohibited
// without the prior written permission of the copyright owner.
//
#endregion

#region Generated code WARNING
//----------------------------------------------------------------------------------------
// This is generated code. If you modify this code, be aware
// of the fact that when you re-generate the code, your changes
// are lost. If you want to keep your changes, make this file read-only
// when you have finished your changes, however it is recommended that
// you create partial class from this class to extend the functionality of this generated
// class or you modify / extend the templates used to generate this code.
//----------------------------------------------------------------------------------------
// Code is generated using t4 templates
// Code is generated on: 26.01.2011 22:58
// Templates vendor: Comtrade IT Solutions and Services (c).
//----------------------------------------------------------------------------------------
#endregion Generated code WARNING

#region Using
using System;
using System.Data;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Collections.Generic;
#endregion Using

namespace Snipebay.DataModels
{
	/// <summary>
    /// Item class definition
    /// </summary>
	[Serializable]
	[DataContractAttribute(Namespace = "Snipebay.ServiceDataContract", Name = "ItemEntity")]
	public partial class ItemEntity : BaseEntity, IItem
	{
		#region Fields
		private long mId;
		private string mName;
		private DateTime mEndTime;
		private decimal mCurrentBid;
		private decimal mShipping;
		private decimal mMaxBid;
		private int mGroupId;
		private bool mBidEnded;
		private int mApplicationUserId;
		private string mStatus;
		#endregion Fields

		#region Constructors

		/// <summary>
		/// Item class default ctor
		/// </summary>
		public ItemEntity() : base() { }

		/// <summary>
		/// Item class ctor with all fields
		/// </summary>
		public ItemEntity(long id, string name, DateTime endTime, decimal currentBid, decimal shipping, decimal maxBid, int groupId, bool bidEnded, int applicationUserId, string status)
		{
			mId = id;
			mName = name;
			mEndTime = endTime;
			mCurrentBid = currentBid;
			mShipping = shipping;
			mMaxBid = maxBid;
			mGroupId = groupId;
			mBidEnded = bidEnded;
			mApplicationUserId = applicationUserId;
			mStatus = status;
		}

		/// <summary>
		/// Item class ctor with data record
		/// </summary>
		public ItemEntity(IDataRecord dataRecord): base(dataRecord)
		{
			long.TryParse(dataRecord["ItemId"].ToString(), out mId);
			//mId = GetValueHelper.GetValue<long>(dataRecord, "ItemId");
			mName = dataRecord["ItemName"].ToString();
			//mName = GetValueHelper.GetValue<string>(dataRecord, "ItemName");
			DateTime.TryParse(dataRecord["EndTime"].ToString(), out mEndTime);
			//mEndTime = GetValueHelper.GetValue<DateTime>(dataRecord, "EndTime");
			decimal.TryParse(dataRecord["CurrentBid"].ToString(), out mCurrentBid);
			//mCurrentBid = GetValueHelper.GetValue<decimal>(dataRecord, "CurrentBid");
			decimal.TryParse(dataRecord["Shipping"].ToString(), out mShipping);
			//mShipping = GetValueHelper.GetValue<decimal>(dataRecord, "Shipping");
			decimal.TryParse(dataRecord["MaxBid"].ToString(), out mMaxBid);
			//mMaxBid = GetValueHelper.GetValue<decimal>(dataRecord, "MaxBid");
			int.TryParse(dataRecord["GroupId"].ToString(), out mGroupId);
			//mGroupId = GetValueHelper.GetValue<int>(dataRecord, "GroupId");
			bool.TryParse(dataRecord["BidEnded"].ToString(), out mBidEnded);
			//mBidEnded = GetValueHelper.GetValue<bool>(dataRecord, "BidEnded");
			int.TryParse(dataRecord["ApplicationUserId"].ToString(), out mApplicationUserId);
			//mApplicationUserId = GetValueHelper.GetValue<int>(dataRecord, "ApplicationUserId");
			mStatus = dataRecord["Status"].ToString();
			//mStatus = GetValueHelper.GetValue<string>(dataRecord, "Status");
			FillExtendedProperties(dataRecord);
		}

		#endregion Constructors

		#region Properties

		/// <summary>
		/// ItemId property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "Id", Order = 1)]
		public long Id
		{
			get
			{
				return mId;
			}
			set
			{
				mId = value;
			}
		}

		/// <summary>
		/// ItemName property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "Name", Order = 2)]
		public string Name
		{
			get
			{
				return mName;
			}
			set
			{
				mName = value;
			}
		}

		/// <summary>
		/// EndTime property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "EndTime", Order = 3)]
		public DateTime EndTime
		{
			get
			{
				return mEndTime;
			}
			set
			{
				mEndTime = value;
			}
		}

		/// <summary>
		/// CurrentBid property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "CurrentBid", Order = 4)]
		public decimal CurrentBid
		{
			get
			{
				return mCurrentBid;
			}
			set
			{
				mCurrentBid = value;
			}
		}

		/// <summary>
		/// Shipping property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "Shipping", Order = 5)]
		public decimal Shipping
		{
			get
			{
				return mShipping;
			}
			set
			{
				mShipping = value;
			}
		}

		/// <summary>
		/// MaxBid property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "MaxBid", Order = 6)]
		public decimal MaxBid
		{
			get
			{
				return mMaxBid;
			}
			set
			{
				mMaxBid = value;
			}
		}

		/// <summary>
		/// GroupId property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "GroupId", Order = 7)]
		public int GroupId
		{
			get
			{
				return mGroupId;
			}
			set
			{
				mGroupId = value;
			}
		}

		/// <summary>
		/// BidEnded property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "BidEnded", Order = 8)]
		public bool BidEnded
		{
			get
			{
				return mBidEnded;
			}
			set
			{
				mBidEnded = value;
			}
		}

		/// <summary>
		/// ApplicationUserId property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "ApplicationUserId", Order = 9)]
		public int ApplicationUserId
		{
			get
			{
				return mApplicationUserId;
			}
			set
			{
				mApplicationUserId = value;
			}
		}

		/// <summary>
		/// Status property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "Status", Order = 10)]
		public string Status
		{
			get
			{
				return mStatus;
			}
			set
			{
				mStatus = value;
			}
		}

		#endregion Properties
	}
}
